package com.wanmait.happyheating.service.impl;

import com.wanmait.happyheating.pojo.City;
import com.wanmait.happyheating.mapper.CityMapper;
import com.wanmait.happyheating.service.CityService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 城市表 服务实现类
 * </p>
 *
 * @author yuQianTao
 * @since 2021-05-13
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class CityServiceImpl extends ServiceImpl<CityMapper, City> implements CityService {
    @Resource
    private CityMapper cityMapper;

    /**
     * 业务逻辑层根据省份id查询所有相对应的城市
     * @param id
     * @return
     */
    @Override
    public List<City> findProvinceId(Integer id) {
        return cityMapper.findProvinceId(id);
    }
}
